x86emul: also test decoding and mem access / write logic
authorJan Beulich <jbeulich@suse.com>
Fri, 29 May 2020 15:29:59 +0000 (17:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 29 May 2020 15:29:59 +0000 (17:29 +0200)
commit3351acaee706b8e238b031a456bf181f97f167c3
tree7a0c59dc408c9be3bc8a0ff18fc9f76c02275d05
parent20bc1b9cc99b70b17757e1903f629c7a26584790
x86emul: also test decoding and mem access / write logic

x86emul_is_mem_{access,write}() (and their interaction with
x86_decode()) have become sufficiently complex that we should have a way
to test this logic. Start by covering legacy encoded GPR insns, with the
exception of a few the main emulator doesn't support yet (left as
comments in the respective tables, or about to be added by subsequent
patches). This has already helped spot a few flaws in said logic,
addressed by (revised) earlier patches.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/tests/x86_emulator/Makefile
tools/tests/x86_emulator/predicates.c [new file with mode: 0644]
tools/tests/x86_emulator/test_x86_emulator.c
tools/tests/x86_emulator/x86-emulate.c
tools/tests/x86_emulator/x86-emulate.h
xen/arch/x86/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.h